//
//  FirstHeadView.m
//  ZiJinLian
//
//  Created by 🐛 on 2017/4/15.
//  Copyright © 2017年 lzy. All rights reserved.
//

#import "FirstHeadView.h"

@implementation FirstHeadView

- (id)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame])
    {
        CGFloat whith=MainW/3-20/3;
        self.backgroundColor=[UIColor whiteColor];
        MYLabel*label=[[MYLabel alloc]initWithFrame:CGRectMake(10, 15, whith, 20)];
        label.text=@"内容";
        label.backgroundColor=[UIColor clearColor];
        label.textColor=TextColor3;
        [self addSubview:label];
        MYLabel*blabel=[[MYLabel alloc]initWithFrame:CGRectMake(10+whith+20, 15, whith, 20)];
        blabel.text=@"定制";
        blabel.backgroundColor=[UIColor clearColor];
        blabel.textColor=TextColor3;
        [self addSubview:blabel];
        MYLabel*clabel=[[MYLabel alloc]initWithFrame:CGRectMake(10+2*whith+20, 15, whith, 20)];
        clabel.text=@"采购";
        clabel.backgroundColor=[UIColor clearColor];
        clabel.textColor=TextColor3;
        [self addSubview:clabel];
        self.bImg=[[UIImageView alloc]initWithFrame:CGRectMake(whith+10, 17.5, 15, 15)];
        self.bImg.image=[UIImage imageNamed:@"icon_rb_pre"];
        [self addSubview:self.bImg];
        self.cImg=[[UIImageView alloc]initWithFrame:CGRectMake(10+2*whith, 17.5, 15, 15)];
        self.cImg.image=[UIImage imageNamed:@"icon_rb_nor"];
        [self addSubview:self.cImg];
        UIButton*tuButton=[[UIButton alloc]initWithFrame:CGRectMake(10+whith, 0, whith, 50)];
        tuButton.selected=YES;
        tuButton.tag=100;
        [tuButton addTarget:self action:@selector(refreshLoadata:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:tuButton];
        UIButton*Cbtn=[[UIButton alloc]initWithFrame:CGRectMake(10+2*whith, 0, whith, 50)];
        Cbtn.tag=101;
        [Cbtn addTarget:self action:@selector(refreshLoadata:) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:Cbtn];
    }
    return self;
}
-(void)refreshLoadata:(UIButton *)sender{
    [_delegate refreshLoadata:sender];
    if (sender.tag==100) {
        self.bImg.image=[UIImage imageNamed:@"icon_rb_pre"];
        self.cImg.image=[UIImage imageNamed:@"icon_rb_nor"];
    }else{
        self.bImg.image=[UIImage imageNamed:@"icon_rb_nor"];
        self.cImg.image=[UIImage imageNamed:@"icon_rb_pre"];
    }

}
@end
